import service from '@/request/index';

// 查询用户信息
export const userInfo = () => {
    return service({
        url: '/me',
        method: 'get',
    })
}

// 查询个人金币
export const userSpecies = () => {
    return service({
        url: '/gameOrders/surplus',
        method: 'get',
    })
}

// 查询分类 购买游戏记录
export const categoriesOrders = () => {
    return service({
        url: '/gameOrders',
        method: 'get',
    })
}

// 查询单独一款游戏 是否被购买
export const gameOrders = (params) => {
    return service({
        url: `/gameOrders/${params}`,
        method: 'get',
    })
}

// 购买游戏
export const gamePay = (data) => {
    return service({
        url: '/gameOrders/pay',
        method: 'post',
        data: JSON.stringify(data)
    })
}